﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace News
{
    public partial class ListNews : CDControlBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            //kiem tra co quyen them bai moi
            this.addLink.NavigateUrl = EditUrl("AddNews");

            //hien so phan tu

            List<dnn_CD_New> listnews = (from b in DbContext.dnn_CD_News
                                         where b.IsPublished.Value && b.TabID.Value == TabId
                                         orderby b.CreatedDate.Value ascending
                                         select b
                                           ).Take(10).ToList();

            this.listNews.DataSource = listNews;
            this.listNews.DataBind();



        }
    }
}